Kinetis SDK Demo Applications User Guide  1.0.0-beta
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
shell.c File Reference
#include <stdio.h>
#include <stdarg.h>
#include "shell.h"

Macros

#define CTL_CH(c)
 
#define CTL_BACKSPACE
 
#define DEL
 
#define DEL7
 
#define CREAD_HIST_CHAR
 
#define putstr(str)
 
#define sgetc()
 
#define sputc(ch)
 
#define BEGINNING_OF_LINE()
 
#define ERASE_TO_EOL()
 
#define REFRESH_TO_EOL()
 

Functions

int cmd_auto_complete (const char *const prompt, char *buf, uint8_t *np, uint8_t *colp)
 auto complete interface function. More...
 
static void putnstr (char *str, uint8_t n)
 send n chars More...
 
int shell_printf (const char *format,...)
 use vsprintf for format. More...
 
uint8_t shell_io_install (shell_io_install_t *IOInstallStruct)
 install shell io function. More...
 
void shell_beep (void)
 beep consult More...
 
const cmd_tbl_t ** shell_get_cmd_tbl (void)
 get global cmdstruct table address More...
 
uint8_t shell_register_function (const cmd_tbl_t *pAddress)
 register a user function More...
 
void shell_register_function_array (const cmd_tbl_t *pAddress, uint8_t num)
 register function array More...
 
uint8_t shell_unregister_function (char *name)
 unregister function More...
 
static void cread_add_char (char ichar, uint8_t insert, uint8_t *num, uint8_t *eol_num, char *buf, uint8_t len)
 add a char to conslt buffer More...
 
static void cread_add_str (char *str, uint8_t strsize, uint8_t insert, uint8_t *num, uint8_t *eol_num, char *buf, uint8_t len)
 add string to conslt buffer More...
 
static int cread_line (const char *const prompt, char *buf, uint8_t *len)
 read line into buffer More...
 
static int readline (char *prompt)
 read line from consult More...
 
static int parse_line (char *line, char *argv[])
 extract from readline More...
 
const cmd_tbl_tshell_find_command (const char *cmd)
 find command form command struct's name More...
 
void shell_main_loop (char *prompt)
 

Variables

static shell_io_install_tgpIOInstallStruct
 
static const cmd_tbl_tgpCmdTable [SHELL_MAX_FUNCTION_NUM]
 
static char console_buffer [SHELL_CB_SIZE+1]
 

Macro Definition Documentation

#define BEGINNING_OF_LINE ( )
#define CREAD_HIST_CHAR
#define CTL_BACKSPACE
#define CTL_CH (   c)
#define DEL
#define DEL7
#define ERASE_TO_EOL ( )
#define putstr (   str)
#define REFRESH_TO_EOL ( )
#define sgetc ( )
#define sputc (   ch)

Function Documentation

int cmd_auto_complete ( const char *const  prompt,
char *  buf,
uint8_t *  np,
uint8_t *  colp 
)
static void cread_add_char ( char  ichar,
uint8_t  insert,
uint8_t *  num,
uint8_t *  eol_num,
char *  buf,
uint8_t  len 
)
static
static void cread_add_str ( char *  str,
uint8_t  strsize,
uint8_t  insert,
uint8_t *  num,
uint8_t *  eol_num,
char *  buf,
uint8_t  len 
)
static
static int cread_line ( const char *const  prompt,
char *  buf,
uint8_t *  len 
)
static
static int parse_line ( char *  line,
char *  argv[] 
)
static
static void putnstr ( char *  str,
uint8_t  n 
)
static
static int readline ( char *  prompt)
static

Variable Documentation

char console_buffer[SHELL_CB_SIZE+1]
static
const cmd_tbl_t* gpCmdTable[SHELL_MAX_FUNCTION_NUM]
static
shell_io_install_t* gpIOInstallStruct
static